package com.zlkj.manager.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zlkj.manager.mapper.PlCommunityHousMapper;
import com.zlkj.manager.domain.PlCommunityHous;
import com.zlkj.manager.service.IPlCommunityHousService;

/**
 * 小区Service业务层处理
 * 
 * @author liubo
 * @date 2022-03-04
 */
@Service
public class PlCommunityHousServiceImpl implements IPlCommunityHousService 
{
    @Autowired
    private PlCommunityHousMapper plCommunityHousMapper;

    /**
     * 查询小区
     * 
     * @param communityHousId 小区主键
     * @return 小区
     */
    @Override
    public PlCommunityHous selectPlCommunityHousByCommunityHousId(Long communityHousId)
    {
        return plCommunityHousMapper.selectPlCommunityHousByCommunityHousId(communityHousId);
    }

    /**
     * 查询小区列表
     * 
     * @param plCommunityHous 小区
     * @return 小区
     */
    @Override
    public List<PlCommunityHous> selectPlCommunityHousList(PlCommunityHous plCommunityHous)
    {
        return plCommunityHousMapper.selectPlCommunityHousList(plCommunityHous);
    }

    /**
     * 新增小区
     * 
     * @param plCommunityHous 小区
     * @return 结果
     */
    @Override
    public int insertPlCommunityHous(PlCommunityHous plCommunityHous)
    {
        plCommunityHous.setCreateTime(DateUtils.getNowDate());
        return plCommunityHousMapper.insertPlCommunityHous(plCommunityHous);
    }

    /**
     * 修改小区
     * 
     * @param plCommunityHous 小区
     * @return 结果
     */
    @Override
    public int updatePlCommunityHous(PlCommunityHous plCommunityHous)
    {
        plCommunityHous.setUpdateTime(DateUtils.getNowDate());
        return plCommunityHousMapper.updatePlCommunityHous(plCommunityHous);
    }

    /**
     * 批量删除小区
     * 
     * @param communityHousIds 需要删除的小区主键
     * @return 结果
     */
    @Override
    public int deletePlCommunityHousByCommunityHousIds(Long[] communityHousIds)
    {
        return plCommunityHousMapper.deletePlCommunityHousByCommunityHousIds(communityHousIds);
    }

    /**
     * 删除小区信息
     * 
     * @param communityHousId 小区主键
     * @return 结果
     */
    @Override
    public int deletePlCommunityHousByCommunityHousId(Long communityHousId)
    {
        return plCommunityHousMapper.deletePlCommunityHousByCommunityHousId(communityHousId);
    }
}
